﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using ChanExt;
using C.Unite;
using C.Entities;
using MySoft.Data;

namespace ArtLand.OA.Project.SystemMgr
{
    public partial class ChangePwd : CommonPageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                btnClose.OnClientClick = ActiveWindow.GetHideReference();
            }
        }


        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            bool bl = true;
            string errortitle = "";
            if (txt_NewPwd.Text != txt_NewPwd2.Text)
            {
                bl = false;
                errortitle = "两次密码输入不一致！";
            }
            if (bl)
            {

                //if (tead().EPW == StringHelper.md5(txt_OldPwd.Text, 16))
                //{
                Sys_Users tea = new Sys_Users();
                    tea.UserID =CookInfo.EAdminid();
                    tea.Attach();
                    tea.Pwd = StringHelper.md5(txt_NewPwd.Text, 16);
                    TbsDbSession.Default.Update<Sys_Users>(tea);
                    Alert.ShowInTop("修改密码成功！");
                    PageContext.RegisterStartupScript(ActiveWindow.GetHideReference());
               
                
            }
            else
            {
                Alert.ShowInTop(errortitle);
            }
        }

    }
}